package com.ttjj.controller;

import com.ttjj.entity.player.PlayReqVo;
import com.ttjj.entity.player.StartBattleReqVo;
import com.ttjj.enums.EnumDirection;
import com.ttjj.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class PlayerController {
    @Autowired
    IPlayerService playerService;

    @Autowired
    PlayerService playerService2;

    @PostMapping("/play")
    public Map<String, EnumDirection> getStep(@RequestBody PlayReqVo entity) {
        return playerService.getStep(entity);
    }

    @PostMapping("/v2/play")
    public Map<String, String> getStep2(@RequestBody Map<String, Object> entity) {
        return playerService2.getStep(entity);
    }

    @PostMapping("/start")
    public void start(@RequestBody StartBattleReqVo startBattleReqVo) {
        playerService.start(startBattleReqVo);
    }
}
